// slices/exampleSlice.js
import { createSlice } from "@reduxjs/toolkit";

const loadingSlice = createSlice({
  name: "loading",
  initialState: {
    value: false,
  },
  reducers: {
    open: (state) => {
      state.value = true; // 使用可变状态
    },
    close: (state) => {
      state.value = false;
    },
  },
});

// 导出 actions 和 reducer
export const { open, close } = loadingSlice.actions;
export default loadingSlice.reducer;
